package com.buddies.lottery.ui.help;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.TextView;

import com.buddies.lottery.App;
import com.buddies.lottery.R;
import com.buddies.lottery.base.BaseActivity;
import com.r0adkll.slidr.Slidr;

public class HelpActivity extends BaseActivity {

    private TextView tvContent;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Slidr.attach(this, App.getSlidrConfig());
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_help;
    }

    @Override
    protected void initView() {
        setUp();

        tvContent = findViewById(R.id.content);
    }

    @Override
    protected void initData() {
        String title = "帮助";
        String content = null;

        Intent intent = getIntent();
        if (intent != null) {
            title = intent.getStringExtra("title");
            content = intent.getStringExtra("content");
        }

        setTitle(title);
        tvContent.setText(content);
    }

    public static void launch(Context context, String title, String content) {
        Intent intent = new Intent(context, HelpActivity.class);
        intent.putExtra("title", title);
        intent.putExtra("content", content);
        context.startActivity(intent);
    }

}
